//
//  Search.swift
//  test1
//
//  Created by Apple on 2021/6/7.
//
/*
 参数：
 currentPageUrl: 点击搜索前的页面的url
 currentPageTitle：点击搜索前的页面的title
 currentPageLogo：点击搜索前的页面的logo
 callBack(可选):使用的回调函数
 */


import SwiftUI
import UIKit

struct SearchView: View {
    var currentPageUrl: String
    var currentPageTitle: String
    var currentPageLogo : Image = Image(systemName: "network")
     
    var callBack:ViewCallBack?
    
    var body: some View {
        VStack{
            SearchBar(callBack: callBack)
            Search(currentPageUrl: currentPageUrl, currentPageTitle: currentPageTitle, currentPageLogo: currentPageLogo, callBack: callBack)
        }
    }
}


struct SearchView_Previews: PreviewProvider {
    static var previews: some View {
        SearchView(currentPageUrl: "https://www.baidu.com", currentPageTitle:"当前标签页的title", currentPageLogo: Image("baidu"))
            .environmentObject(HistoryListModelData())
    }
}
